<%-------------------------------------------------------------------
 * 页面名称：forgotIVRPass.jsp
 * 功能描述：使用手机或者email重置电话银行密码
 * Action  : 
 *
 *-------------------------------------------------------------------
--%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ page import="cn.agiledata.bank.common.util.WeatherUtil"%>
<%@ page import="cn.agiledata.bank.account.service.IAccountConst"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-bean.tld" prefix="bean"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ipb" uri="/WEB-INF/conf/tld/ipb.tld"%>
<%@ taglib prefix="ad" uri="agiledata"%>
<%
	String path = request.getContextPath();
	String r_email = WeatherUtil.getLoingInfoFromSession(request)
			.getAccount().getEmail();
	String r_mobile = WeatherUtil.getLoingInfoFromSession(request)
			.getAccount().getMobile();
	if (r_email == null)
		r_email = "";
	if (r_mobile == null)
		r_mobile = "";

	String r = null;
	if (request.getParameter("r") != null) {
		r = request.getParameter("r").toString();
	}

	String modifyType = (String) request.getParameter("modifyType");
	if (modifyType == null) {
		modifyType = IAccountConst.MODIFY_TYPE_LOGIN;
	}
	String passwordType = "登录";
	if (modifyType.equals(IAccountConst.MODIFY_TYPE_PAY)) {
		passwordType = "支付";
	}
%>
<script language="javascript">
	function applyByEmail() {
		if (emptyValidate(getObj("email"),"Email地址") != "") {
			return false;
		}
		if (!checkEmail(getObj("email"))) {
			alert("Email地址格式不正确，请重新填写！");
			return false;
		}
		if (emptyValidate(getObj("emailVericode"),"校验码") != "") {
			return false;
		}
		document.forms[0].action = '<%=path%>/page/myspace/applyResetIVRPasswordByEmail.do';
		document.forms[0].submit();
	}
	function applyByMobile() {
		if (emptyValidate(getObj("mobile"),"手机号码") != "") {
			return false;
		}
		if (!mobileValidate(getObj("mobile"))) {
			return false;
		}
		if (emptyValidate(getObj("mobileVericode"),"校验码") != "") {
			return false;
		}
		document.forms[0].action = '<%=path%>/page/myspace/applyResetIVRPasswordByMobile.do';
		document.forms[0].submit();
	}
	function resetByEmail() {
		location.href = '<%=path%>/page/myspace/toResetIVRPasswordByEmail.do?modifyType=<%=modifyType%>';
	}
	function resetByMobile() {
		location.href = '<%=path%>/page/myspace/toResetIVRPasswordByMobile.do?modifyType=<%=modifyType%>';
	}
	function showTr(showId, hideId) {
		if ('<%=r_email%>'=='' && showId=='email') {
			alert('您的登录账号没有绑定Email！');
			return;
		}
		if ('<%=r_mobile%>'=='' && showId=='mobile') {
			alert('您的登录账号没有绑定手机！');
			return;
		}
		getObj(showId+'Tr1').style.display = '';
		getObj(showId+'Tr2').style.display = '';
		getObj(showId+'Tr3').style.display = '';
		document.getElementById(showId+'Tab').className = 'on';
		
		getObj(hideId+'Tr1').style.display = 'none';
		getObj(hideId+'Tr2').style.display = 'none';
		getObj(hideId+'Tr3').style.display = 'none';
		document.getElementById(hideId+'Tab').className = 'off';
		
		var now = new Date();
		getObj('verifyImage').src = '<%=path%>/page/util/verifyImage.jsp?now='+now.getTime().toString();
	}
</script>
<Style>
<!--
.box {width:100%;margin:auto;}
.off {margin-left:3px;line-height:34px;float:left;width:300px;height:34px;color:#003365;font-size:14px;font-weight:bold;text-align:center;background-image:url(<%=path%>/images/p_on02.gif);cursor:pointer;}
.on {margin-left:3px;line-height:34px;float:left;width:300px;height:34px;color:#B77443;font-size:14px;font-weight:bold;text-align:center;background-image:url(<%=path%>/images/p_hover02.gif);}
.tab {width:100%;margin:auto;float:left;background:url(<%=path%>/images/apply_bg.gif) top left no-repeat}
-->
</style>
<div id="mainFrame">
	<div class="rightSider">
		<div class="sub_title">
			<span class="bluefont18bdrop">重置电话账户登陆密码</span>
		</div>
		<div class="edit_pass">
			<div class="tab">
				<div class="off" id="emailTab" onclick="showTr('email', 'mobile');">
					使用Email申请重置电话账户
					<%=passwordType%>
					密码
				</div>
				<div class="off" id="mobileTab" onclick="showTr('mobile', 'email');">
					使用手机申请重置电话账户
					<%=passwordType%>
					密码
				</div>
			</div>
			<div class="drop_bg"></div>
			<div style="clear:both;"></div>
			<div class="box" id="cont_1">
				<form method="post">
					<input type="hidden" name="modifyType" value="<%=modifyType%>" />
					<table width="100%" border="0" align="center" cellpadding="7"
						cellspacing="1" bgcolor="#f9e277" style="margin:10px 0;">
						<tr>
							<td bgcolor="#fffdf5" colspan="2">
								<table width="100%" border="0" cellpadding="3" cellspacing="0">
									<tr>
										<td width="3%" height="25" valign="top"
											style="border-bottom:1px solid #ccc;"></td>
										<td width="97%" align="left" class="red12b"
											style="border-bottom:1px solid #ccc;">
											特别提醒
										</td>
									</tr>
									<tr id="emailTr1">
										<td valign="top">
											&nbsp;
										</td>
										<td class="font_gray">
											如果您的登录账号是使用Email注册的，或者绑定了Email，我们可以将重置电话账户
											<%=passwordType%>
											密码的
											<span class="text9green">确认码发送到您的Email里</span>。
											<br />
											如果您已经得到了该邮件，请直接进入下一步，
											<span class="redColor12px">填写您的Email地址</span>，收到的确认码以及重新设置的电话账户
											<%=passwordType%>
											密码。
										</td>
									</tr>
									<tr id="mobileTr1">
										<td valign="top">
											&nbsp;
										</td>
										<td class="font_gray">
											如果您的登录账号是使用手机号码注册的，或者绑定了手机，我们可以将重置电话账户
											<%=passwordType%>
											密码的
											<span class="text9green">确认码发送到您的手机里</span>。
											<br />
											如果您已经得到了该短信，请直接进入下一步，
											<span class="redColor12px">填写您的手机号码</span>，收到的确认码以及重新设置的电话账户
											<%=passwordType%>
											密码。
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
					<table width="100%" border="0" align="center" cellpadding="5"
						cellspacing="1">
						<tr id="emailTr2">
							<td align="right" bgcolor="#FFFFFF">
								您的Email地址：
							</td>
							<td width="77%" bgcolor="#FFFFFF">
								<input name="email" type="text" size="40" class="inputStyle"
									value="<%=r_email%>" readonly />
							</td>
						</tr>
						<tr id="mobileTr2">
							<td align="right" bgcolor="#FFFFFF">
								您的手机号码：
							</td>
							<td width="77%" bgcolor="#FFFFFF">
								<input name="mobile" type="text" size="40" class="inputStyle"
									value="<%=r_mobile%>" readonly />
							</td>
						</tr>
						<tr>
							<td align="right" bgcolor="#FFFFFF">
								请输入图片里的校验码：
							</td>
							<td bgcolor="#FFFFFF">
								<input name="vericode" type="text" class="inputStyle" />
								<img id="verifyImage" src="<%=path%>/page/util/verifyImage.jsp"
									width="60" height="24" align="absmiddle" />
							</td>
						</tr>
						<tr id="emailTr3">
							<td align="right" bgcolor="#FFFFFF"></td>
							<td bgcolor="#FFFFFF">
								<a href="#" onclick="applyByEmail();" class="dropblue14b">获取重置电话账户<%=passwordType%>密码的确认码</a>&nbsp;&nbsp;&nbsp;&nbsp;
								<a href="#" onclick="resetByEmail();" class="dropblue14b">直接进入下一步</a>
							</td>
						</tr>
						<tr id="mobileTr3">
							<td align="right" bgcolor="#FFFFFF"></td>
							<td bgcolor="#FFFFFF">
								<a href="#" onclick="applyByMobile();" class="dropblue14b">获取重置电话账户<%=passwordType%>密码的确认码</a>&nbsp;&nbsp;&nbsp;&nbsp;
								<a href="#" onclick="resetByMobile();" class="dropblue14b">直接进入下一步</a>
							</td>
						</tr>
					</table>
				</form>
			</div>
		</div>
	</div>
</div>
<div align="center">
	<!-- include 我的账户左侧账户管理菜单 -->
	<jsp:include page="left.jsp?current=telacct" />
</div>
<script language="javascript">
	<% if (r_email.equals("") || (r!=null && r.equals("m"))) { %>
		showTr('mobile', 'email');
	<% } else { %>
		showTr('email', 'mobile');
	<% } %>
</script>
<script type="text/javascript"> 
function showTab(ID) 
{ 
    for(var i=1;i<=2;i++) 
    { 
        if(ID==i) 
        { 
            $('Tab_'+i).className='on'; 
            $('cont_'+i).style.display=''; 
        } 
        else 
        { 
            $('Tab_'+i).className='off'; 
            $('cont_'+i).style.display='none'; 
        } 
    } 
} 
function $(ID) 
{ 
    return document.getElementById(ID); 
} 
  </script>
<script type="text/javascript"> 
function showTab2(ID) 
{ 
    for(var i=1;i<=2;i++) 
    { 
        if(ID==i) 
        { 
            $('Tab2_'+i).className='on'; 
            $('cont2_'+i).style.display=''; 
        } 
        else 
        { 
            $('Tab2_'+i).className='off'; 
            $('cont2_'+i).style.display='none'; 
        } 
    } 
} 
function $(ID) 
{ 
    return document.getElementById(ID); 
} 
</script>
